package ysc.cqnu.operdb.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import ysc.cqnu.operdb.entity.ReceiveUserInfo;
import ysc.cqnu.operdb.entity.ResultData;
import ysc.cqnu.operdb.serviceImpl.UserLoginServiceImpl;

@CrossOrigin
@Controller
@ResponseBody
public class LoginController {
    @Autowired
    private ResultData resultData;
    @Autowired
    private UserLoginServiceImpl userLoginServiceImpl;

    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public ResultData login(@RequestBody ReceiveUserInfo receiveLogin){
        System.out.println("登录前端已连接");
        resultData = userLoginServiceImpl.isLogin(receiveLogin);
        return resultData;
    }
}
